begintownscript;

variables;
short bmessage,riders,rctx,ridersx,ridersy;
string custom_m;

body;

beginstate INIT_STATE;

	force_instant_terrain_redraw();
	reset_dialog();
	add_dialog_str(0,"This crevasse seems to go up until where the rocks smooth down in the distance.  Anthony was right- this IS a lucky break.",0);
	add_dialog_str(1,"Anthony turns to you, looking nervous.",0);
	add_dialog_str(2,"_I know it looks like we're out of the clear, but I'm going to scout on ahead.  I'll be waiting for you again._",0);
	add_dialog_str(3,"Suddenly, he leaps forward, leaving you in the dust.  How strange; however, it appears to be commonplace with him.",0);
	bmessage = run_dialog(1);

	remove_char_from_party(317);

break;

beginstate EXIT_STATE;
break;

beginstate START_STATE;

	if(get_flag(26,0) >= 42 && is_combat() == TRUE){
		message_dialog("Apparently, _sudden movements_ included unsheathing your weapons.","By the time you hear the arrows being launched at you, they have already embedded themselves in your heart and lungs.  Ratbane was not bluffing; indeed, he was well-supported.");

		kill_char(1000,2,0);
	}

break;

beginstate 10;

	message_dialog("No, no.  Anthony is waiting for you.  You had best follow his advice, as he knows the best way to get out of here alive.","");
	block_entry(1);

break;

beginstate 11;

	if(get_flag(26,0) < 42){

		if(is_combat() == 1){
			block_entry(1);
			end();
		}

		reset_dialog();
		add_dialog_str(0,"Suddenly, you see a well-dressed nephil.  He is standing out in the middle of the path only barely beyond your range, and he seems to be very confident.",0);
		clear_buffer();
		append_string("_Stop right there, ");
		append_char_name(0);
		append_string(".  This is as far as ");
		if(party_size() > 2)
			append_string("all of ");
		if(party_size() == 2)
			append_string("the both of ");
		append_string("you will be going so freely today._");
		get_buffer_text(custom_m);
		add_dialog_str(1,custom_m,0);
		add_dialog_str(2,"_I am Ratbane XIV, supreme commander of the Ratbane Clan Army.  And yes, I can speak your language- fortunate for you, as now you have the opportunity to surrender peacefully!_",0);
		add_dialog_str(3,"_Come.  Approach, and we will parley.  And do not think of attacking or making any sudden movements, for I am better protected than you know._",0);
		add_dialog_str(4,"Anthony...  Did he know about this?  Is that why he ran?  He left you here to die!",0);
		bmessage = run_dialog(1);

		set_flag(26,0,42);
	}

break;

beginstate 12;

	if(get_flag(26,0) >= 42){
		reset_dialog();
		add_dialog_str(0,"Ratbane XIV seems irritated with you.",0);
		add_dialog_str(1,"_You do not wish to leave so soon.  Come this way immediately._",0);
		add_dialog_choice(0,"Stay Here");
		add_dialog_choice(1,"Proceed Away");
		bmessage = run_dialog(0);

		if(bmessage == 1){
			block_entry(1);
			end();
		}

		message_dialog("By the time you hear the arrows being launched at you, they have already embedded themselves in your heart and lungs.  Ratbane was not bluffing; indeed, he was well-supported.","");

		kill_char(1000,2,0);
	}

break;

beginstate 13;

	pause(4);
	reset_dialog();
	add_dialog_str(0,"_That...  That is close enough, yes._",0);
	add_dialog_str(1,"He raises his fingers into the air and rubs his claws together, causing a series of snapping noises.",0);
	add_dialog_str(2,"_Mina kokoe bitte sei!_",0);
	bmessage = run_dialog(1);

	pause(6);

	activate_hidden_group(1);
	force_instant_terrain_redraw();
	pause(5);

	rctx = 0;
	while(rctx <= 4){
		riders = 22;
		while(riders <= 37){
			ridersx = (char_loc_x(riders) + 1);
			ridersy = char_loc_y(riders);
			relocate_character(riders,ridersx,ridersy);

			riders = (riders + 1);
		}

		force_instant_terrain_redraw();
		pause(3);

		rctx = (rctx + 1);
	}

	pause(5);

	reset_dialog();
	add_dialog_str(0,"...Wow.  So that is the army Ratbane was referring to.",0);
	add_dialog_str(1,"Archers line the cliffs and are woven among the rocks, nomads are numerous and behind him, and there's plenty of shamans.  All in all, the situation is not too good.",0);
	add_dialog_str(2,"_Let us parley, then?_",0);
	if(get_flag(99,0) == 1){
		if(party_size() == 1)
			add_dialog_choice(0,"What do you want with me?");
		if(party_size() > 1)
			add_dialog_choice(0,"What do you want with us?");
	}
	if(get_flag(99,0) == 2)
		add_dialog_choice(0,"...");
	bmessage = run_dialog(1);

	reset_dialog();
	if(party_size() > 1)
		add_dialog_str(0,"_I want you to allow yourselves to be blindfolded and taken with us._",0);
	if(party_size() == 1)
		add_dialog_str(0,"_I want you to allow yourself to be blindfolded and taken with us._",0);
	clear_buffer();
	append_string("_This may seem like a painful way to die, but you are lucky, insomuch as I have been given explicit directions to not let ");
	if(party_size() == 2)
		append_string("the two of ");
	if(party_size() == 3)
		append_string("the three of ");
	if(party_size() == 4)
		append_string("the four of ");
	append_string("you die here.  Until you reach my fortress, your ");
	if(party_size() > 1)
		append_string("lives ");
	if(party_size() == 1)
		append_string("life ");
	append_string("will yet be yours._");
	get_buffer_text(custom_m);
	add_dialog_str(1,custom_m,0);
	add_dialog_str(2,"_So, what say you?  Will you consent, or will you die?  Think it over- you will be painlessly reaching the heart of our operations!  Why, with enough ability, you may end this all!  Does that not sound tempting?_",0);
	if(get_flag(99,0) == 1)
		add_dialog_choice(0,"Do as you must.");
	if(get_flag(99,0) == 2)
		add_dialog_choice(0,"This is your worst mistake.  Go ahead.");
	bmessage = run_dialog(1);

	force_view_center(47,47);
	force_instant_terrain_redraw();
	pause(5);

	if(get_flag(99,0) == 1)
		message_dialog("The nephilim hidden behind you tie cloths around your head very quickly.  You opt not to resist.  Ropes are tied to your wrists, and they begin moving you through the valley at a brisk pace.","Wherever Anthony is, you can only hope that this is part of his plan.");
	if(get_flag(99,0) == 2)
		message_dialog("The nephilim hidden behind you tie cloths around your head very quickly.  You opt not to resist.  Ropes are tied to your wrists, and they begin moving you through the valley at a brisk pace.","Wherever Anthony is, he had better pay for what he did to you soon.");
	set_ticks_forward(3500);
	force_instant_terrain_redraw();

	move_to_new_town(9,9,9);

break;
